﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CustomerSearch.aspx.cs"
    Inherits="BEGDC.CC.Web.CIS2.Domestic.Search.CustomerSearch" %>

<%@ Register Src="../../../UserControls/Pager2.ascx" TagName="Pager2" TagPrefix="cc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link href="../../../css/global.css" rel="stylesheet" type="text/css" />
    <link href="../../../css/main.css" rel="stylesheet" type="text/css" />
    <link href="../../../css/content/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
    <link href="../../../css/content/entity.css" rel="stylesheet" type="text/css" />

    <script src="../../../js/jquery-1.4.4.min.js" type="text/javascript"></script>

    <script src="../../../js/jquery-ui.min.js" type="text/javascript"></script>

    <script src="../../../js/entity.js.aspx" type="text/javascript"></script>
    <script type="text/javascript">
        $(function() {
            $(".linkurl").each(function() {
                var url = $(this).attr("href");
                var link = '<%=GetUserType() %>';
                if (link == "ove")
                    url = "../../Overseas" + url;
                else
                    url = ".." + url;
                $(this).attr("href", url);
            });
            $("#selectArea").bind("change", function() {
                var areaID = $(this).val();
                var cil = '<%=GetCil() %>';
                var params = '{cil:"' + cil + '",areaID:"' + areaID + '"}';
                $.ajax({
                    type: "POST",
                    url: "CompanySearch.aspx/GetCountryByArea",
                    data: params,
                    dataType: "json",
                    contentType: "application/json; charset=utf-8",
                    success: function(result) {
                        $("#selectCountry").empty();
                        $("#selectCountry").append("<option value=0 selected>--请选择--</option>");
                        var res = result.d.split(',');
                        for (var i = 0; i < res.length; i++) {
                            if (res[i] != "") {
                                var ret = res[i].split(';');
                                $("#selectCountry").append("<option value=" + ret[0] + ">" + ret[1] + "</option>");
                            }
                        }

                    },
                    error: function(xhr, msg, e) {
                        alert("wrong");

                    }
                });
            });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="mainbox">
        <div class="sitemapbox">
            <div class="sitemap">
                &nbsp;»&nbsp;Search&nbsp;»&nbsp;Customer Search
            </div>
        </div>
        <table width="100%">
            <tr>
                <td>
                    <!--tab区域-->
                    <div class="tabbox purplebg_dark">
                        <ul class="tabpos">
                            <li><span class="tab_active">
                                <%=Resources.PageTitles.CustomerSearch%></span></li>
                        </ul>
                    </div>
                </td>
            </tr>
        </table>
        <table width="100%" border="0" class="formbox_fieldset2">
            <tr class="title">
                <td colspan="4">
                    <span>&nbsp;&raquo;&nbsp;Basic information (基本信息):</span>
                </td>
            </tr>
            <tr>
                <td class="bg">
                    &nbsp;&nbsp;Customer Name (姓名):
                </td>
                <td>
                    <asp:TextBox ID="txtCustomerName" runat="server" CssClass="txtbox" onmouseover="this.className='txtboxover';"
                        onmouseout="this.className='txtbox';"></asp:TextBox>
                </td>
                <td class="bg">
                    &nbsp;&nbsp;&nbsp;&nbsp;Compnay Name (公司名称):
                </td>
                <td>
                    <asp:TextBox ID="txtCompanyName" runat="server" CssClass="txtbox" onmouseover="this.className='txtboxover';"
                        onmouseout="this.className='txtbox';"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="bg">
                    &nbsp;&nbsp;Customer Title (客户职位):
                </td>
                <td>
                    <asp:TextBox ID="txtTitle" runat="server" CssClass="txtbox" onmouseover="this.className='txtboxover';"
                        onmouseout="this.className='txtbox';"></asp:TextBox>
                </td>
                <td class="bg">
                    &nbsp;&nbsp;Customer Level (客户等级):
                </td>
                <td>
                    <asp:DropDownList ID="selectlevel" runat="server" Width="208" CssClass="formfont" />
                </td>
            </tr>
            <div id="domestic" runat="server">
                <tr>
                    <td class="bg">
                        &nbsp;&nbsp;Province (省份名称):
                    </td>
                    <td>
                        <asp:DropDownList ID="selectProvince" runat="server" Width="208">
                        </asp:DropDownList>
                    </td>
                    <td class="bg">
                        &nbsp;&nbsp;CAT (CAT名称):
                    </td>
                    <td>
                        <asp:DropDownList ID="selectCategory" runat="server" Width="208">
                        </asp:DropDownList>
                    </td>
                </tr>
            </div>
            <div id="overseas" runat="server">
                <tr>
                    <td class="bg">
                        &nbsp;&nbsp; Region (区域):
                    </td>
                    <td>
                        <asp:DropDownList ID="selectArea" runat="server" Width="208">
                        </asp:DropDownList>
                    </td>
                    <td class="bg">
                        &nbsp;&nbsp;Country (国家):
                    </td>
                    <td>
                        <asp:DropDownList ID="selectCountry" runat="server" Width="208">
                        </asp:DropDownList>
                    </td>
                </tr>
            </div>
            <tr>
                <td class="bg">
                    &nbsp;&nbsp;Creator (创建人):
                </td>
                <td>
                    <asp:TextBox ID="txtEdit" runat="Server" CssClass="txtbox" onmouseover="this.className='txtboxover';"
                        onmouseout="this.className='txtbox';"></asp:TextBox>
                </td>
                <td class="bg">
                </td>
                <td>
                </td>
            </tr>
        </table>
        <table width="100%" border="0" class="formbox_fieldset2">
            <tr class="title">
                <td colspan="4">
                    <span>&nbsp;&raquo;&nbsp;Study Experiences (学习经历):</span>
                </td>
            </tr>
            <tr>
                <td class="bg">
                    &nbsp;&nbsp;Degree (学位):
                </td>
                <td>
                    <asp:DropDownList ID="selectDegree" runat="server" Width="210" CssClass="formfont">
                    </asp:DropDownList>
                </td>
                <td class="bg">
                    &nbsp;&nbsp;Graduate School (毕业学校):
                </td>
                <td>
                    <asp:TextBox ID="txtSchool" runat="server" CssClass="txtbox" onmouseover="this.className='txtboxover';"
                        onmouseout="this.className='txtbox';"></asp:TextBox>
                </td>
            </tr>
        </table>
        <table width="100%" border="0" class="formbox_fieldset2">
            <tr class="title">
                <td colspan="4">
                    <span>&nbsp;&raquo;&nbsp;Work experience (工作经历):</span>
                </td>
            </tr>
            <tr>
                <td class="bg">
                    &nbsp;&nbsp;Company Name (公司名称):
                </td>
                <td>
                    <asp:TextBox ID="txtOldCompanyName" runat="server" CssClass="txtbox" onmouseover="this.className='txtboxover';"
                        onmouseout="this.className='txtbox';"></asp:TextBox>
                </td>
                <td class="bg">
                    &nbsp;&nbsp;TItle (职位):
                </td>
                <td>
                    <asp:TextBox ID="txtOldTitle" runat="server" CssClass="txtbox" onmouseover="this.className='txtboxover';"
                        onmouseout="this.className='txtbox';"></asp:TextBox>
                </td>
            </tr>
        </table>
        <div class="formbox">
            <asp:ResourceButton ID="btnOK" runat="server" Text="Search" ToolTip="SearchTips"
                OnClick="btnOK_Click" CssClass="btn" />
            <asp:ResourceButton ID="btnClear" runat="server" Text="Clear" ToolTip="ClearTips"
                OnClick="btnClear_Click" CssClass="btn" />
            <asp:ResourceButton ID="btnExport" runat="server" Text="Export" ToolTip="ExportTips"
                CssClass="btn" OnClick="btnExport_Click" />
            <asp:ResourceButton ID="btnExportEmail" runat="server" Text="ExportEmailList" ToolTip="ExportEmailTips"
                CssClass="btn" OnClick="btnExportEmail_Click" />
        </div>
        <div>
            <asp:GridView ID="GVCustomer" runat="server" AutoGenerateColumns="False" DataKeyNames="CustomerID"
                DataSourceID="edsCustomer" Visible="False" PageSize="5" AllowPaging="True" CssClass="tablestyle"
                EmptyDataText="There is no data to display!" AllowSorting="true">
                <FooterStyle />
                <RowStyle CssClass="tbody" />
                <PagerStyle CssClass="pagecounting2" HorizontalAlign="right" />
                <SelectedRowStyle />
                <HeaderStyle CssClass="thead" ForeColor="#ffffff" />
                <Columns>
                    <asp:TemplateField HeaderText="Customer Name<br/>姓名" SortExpression="Name">
                        <ItemTemplate>
                            <%#Eval("Name") %>
                        </ItemTemplate>
                        <ItemStyle Width="21%" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Company name <br/>公司名称" SortExpression="Company.CompanyID">
                        <ItemTemplate>
                            <asp:Label ID="Company" runat="server" Text='<%#Eval("Company.Name")%>' />
                        </ItemTemplate>
                        <ItemStyle Width="26%" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Department<br/>部门" SortExpression="CustomerDepartment.DepartmentID">
                        <ItemTemplate>
                            <asp:Label ID="Department" runat="server" Text='<%#Eval("CustomerDepartment.Name")%>' />
                        </ItemTemplate>
                        <ItemStyle Width="16%" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="Title" HeaderText="Title<br/>职位" HtmlEncode="false" SortExpression="Title"
                        ItemStyle-Width="16%" />
                    <asp:TemplateField HeaderText="Creator<br/>创建人" SortExpression="CreateBy.EmployeeNo">
                        <ItemTemplate>
                            <asp:Label ID="LastModifyBy" runat="server" Text='<%#Eval("CreateBy.NameEN") %>' />
                        </ItemTemplate>
                        <ItemStyle Width="14%" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Action<br/>操作">
                        <ItemTemplate>
                            <a class="linkurl" href="/CustomerInfo.aspx?view=<%#Eval("CustomerID") %>">
                                <asp:Image runat="server" ImageUrl="~/images/stock-edit-16.gif" ToolTip="View (查看)" /></a></ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <PagerTemplate>
                    <cc:Pager2 runat="server" />
                </PagerTemplate>
            </asp:GridView>
        </div>
        <asp:GridView ID="GVExport" runat="server" AutoGenerateColumns="False" DataKeyNames="CustomerID"
            DataSourceID="edsCustomer" Visible="false">
            <Columns>
                <asp:BoundField DataField="CustomerID" HeaderText="CustomerID<br/>客户编号" ReadOnly="True"
                    SortExpression="CustomerID" HtmlEncode="false" />
                <asp:BoundField DataField="Name" HeaderText="Name<br/>姓名" SortExpression="Name" HtmlEncode="false" />
                <asp:TemplateField HeaderText="Gender<br/>性别">
                    <ItemTemplate>
                        <%# GetGender(Eval("Gender"))%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField HeaderText="Birthday<br/>生日" DataField="Birthday" SortExpression="Birthday"
                    HtmlEncode="false" />
                <asp:BoundField HeaderText="Cell Phone<br/>手机号码" DataField="CellPhone" SortExpression="CellPhone"
                    HtmlEncode="false" />
                <asp:BoundField HeaderText="Email<br/>邮箱" DataField="Email" SortExpression="Email"
                    HtmlEncode="false" />
                <asp:BoundField HeaderText="Address<br/>家庭住址" DataField="Address" SortExpression="Address"
                    HtmlEncode="false" />
                <asp:BoundField HeaderText="Nationality<br/>国籍" DataField="Nationality" SortExpression="Nationality"
                    HtmlEncode="false" />
                <asp:TemplateField HeaderText="Company<br/>公司">
                    <ItemTemplate>
                        <%#Eval("Company.Name") %></ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Department<br/>部门">
                    <ItemTemplate>
                        <%#Eval("CustomerDepartment.Name")%></ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Title" HeaderText="Title<br/>职位" SortExpression="Title"
                    HtmlEncode="false" />
                <asp:TemplateField HeaderText="Level<br/>级别">
                    <ItemTemplate>
                        <%#(int)Eval("Level")==0?"":"Level"%>&nbsp
                        <asp:Label ID="Level" runat="server" Text='<%#(int)Eval("Level")==0?"":Eval("Level")%>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField HeaderText="Create Time<br/>创建时间" DataField="CreateTime" SortExpression="CreateTime"
                    HtmlEncode="false" />
                <asp:TemplateField HeaderText="CreateBy<br/>创建人">
                    <ItemTemplate>
                        <%#Eval("CreateBy.NameEN") %></ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField HeaderText="LastModify Time<br/>最后修改时间" DataField="LastModifyTime"
                    SortExpression="LastModifyTime" HtmlEncode="false" />
                <asp:TemplateField HeaderText="LastModifyBy<br/>最后修改人">
                    <ItemTemplate>
                        <%#Eval("LastModifyBy.NameEN")%></ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField HeaderText="Description<br/>备注" DataField="Description" SortExpression="Description"
                    HtmlEncode="false" />
            </Columns>
        </asp:GridView>
        <asp:GridView ID="GVExportEmail" runat="server" AutoGenerateColumns="False" DataKeyNames="CustomerID"
            DataSourceID="edsCustomer" Visible="false">
            <Columns>
                <asp:BoundField DataField="Name" HeaderText="Name<br/>姓名" SortExpression="Name" HtmlEncode="false" />
                <asp:BoundField HeaderText="Email<br/>邮箱" DataField="Email" SortExpression="Email"
                    HtmlEncode="false" />
                <asp:TemplateField HeaderText="Company<br/>公司名称">
                    <ItemTemplate>
                        <%#Eval("Company.Name") %></ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <asp:EntityDataSource ID="edsCustomer" runat="server" ConnectionString="name=CCEntities"
            DefaultContainerName="CCEntities" EnableDelete="True" EnableInsert="True" EnableUpdate="True"
            EntitySetName="Customers" Where="it.Disabled==false" Include="LastModifyBy,Company,CustomerDepartment,Definition,Education,FamilyInfo,WorkExperience,CustomerDepartment,CustomerPreference">
        </asp:EntityDataSource>
    </form>
    <%--页面刷新时显示--%>
    <%-- <div id="dialog-message" title="Loading..." style="display: none">
        <p>
            <br />
            <span class="entity-loading"></span><span>Operation in process, please wait...<br />
                <br />
                处理中, 请稍候。。。</span>
        </p>
    </div>--%>
</body>
</html>
